package net.organizer.ui.actionhandler;

import java.util.logging.Logger;

import javax.servlet.http.HttpServletRequest;

import org.json.JSONObject;

import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

public class GetContextActionHandler extends ActionHandlerBase {

private static final Logger logger = Logger.getLogger(GetContextActionHandler.class.getName());

@Override
public void handleAction(final HttpServletRequest req, final JSONObject respJSONObject)
  throws Exception {
  logger.fine("handleAction");
  UserService userService = UserServiceFactory.getUserService();
  User user = userService.getCurrentUser();
  respJSONObject.put("user", user);
  respJSONObject.put("logoutUrl", userService.createLogoutURL("/home.html"));
  
}

}
